Calculate the volume of a tetrahedron¶
Calculate the volume of a tetrahedron.
Note:
In geometry, a tetrahedron (plural: tetrahedra or tetrahedrons)
is a polyhedron composed of four triangular faces, six straight edges,
and four vertex corners.
The tetrahedron is the simplest of all the ordinary convex
polyhedra and the only one that has fewer than 5 faces.
Expected output:
117.85
import math
def volume_tetrahedron(num):
volume = (num ** 3 / (6 * math.sqrt(2)))
return round(volume, 2)
# test
print(volume_tetrahedron(10)) # 117.85